import request from '@/utils/request.js'
import { useTokenStore } from '@/stores/token'

//文章分类列表
export const articleCategoryListSer=()=>{
    //const tokenStore=useTokenStore();
    //return request.get('/category',{headers:{'Authorization':tokenStore.token}})
    return request.get('/category')
}

//文章分类添加
export const articleCategoryAddSer=(categoryData)=>{
    return request.post('/category', categoryData)
}

//文章分类修改
export const articleCategoryUpdateSer=(categoryData)=>{
    return request.put('/category', categoryData)
}

//文章分类删除
export const articleCategoryDeleteSer=(id)=>{
    return request.delete('/category?id='+id);
}

//文章列表查询
export const articleListSer=(params)=>{
    return request.get('/article',{params:params})
}

//文章添加
export const articleAddSer=(articleData)=>{
    return request.post('/article',articleData)
}
